package com.gezhi.clsserver.clsmag.service.impl;

import com.gezhi.clsserver.bean.ClassBean;
import com.gezhi.clsserver.clsmag.mapper.ClassMapper;
import com.gezhi.clsserver.clsmag.service.IClassService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * 班级业务功能接口实现类
 *
 * @author AWG
 */
@Service
public class ClassServiceImpl implements IClassService {

	@Resource
	private ClassMapper classMapper;

	/**
	 * 新增班级
	 *
	 * @param classBean 班级对象
	 */
	@Override
	public void saveClass(ClassBean classBean) {
		classMapper.saveClass(classBean);
	}

	/**
	 * 修改班级
	 *
	 * @param classBean 班级对象
	 */
	@Override
	public void updateClass(ClassBean classBean) {
		classMapper.updateClass(classBean);
	}

	/**
	 * 删除班级
	 *
	 * @param classBean 班级对象
	 */
	@Override
	public void deleteClass(ClassBean classBean) {
		classMapper.deleteClass(classBean);
	}

	/**
	 * 根据班级ID查询班级
	 *
	 * @param id 班级ID
	 */
	@Override
	public ClassBean getClassById(Integer id) {
		return classMapper.getClassById(id);
	}

	/**
	 * 查询所有的班级
	 *
	 * @return 所有的班级组成的List集合
	 */
	@Override
	public List<ClassBean> findAllClass() {
		return classMapper.findAllClass();
	}
}
